var https = require("https");
var qs = require("querystring");

const param = qs.stringify({
  grant_type: "client_credentials",
  client_id: "LnA6ctAFP4sVdQ4PBvMy3WZQ",
  client_secret: "3WeHImjhov6gGgFnyUXgFQyuMLCqGc09",
});

https.get(
  {
    hostname: "aip.baidubce.com",
    path: "/oauth/2.0/token?" + param,
    agent: false,
  },
  function (res) {
    // 在标准输出中查看运行结果
    //"access_token":"24.157f5924581ef56d0e2accffdb637b1e.2592000.1638595648.282335-25105024"
    res.pipe(process.stdout);
  }
);
